﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
using System.Data;
using System.Text;

namespace IHISCETeim.Web.MachineSys.FTradeModel
{
    public partial class FTradeUpKeepList : PageBase
    {
        protected override string DWZRef
        {
            get
            {
                return "FTradeReceivablesListEasyUI";
            }
        }

        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.应收帐款_维修保养费 };
            }
        }

        protected int FTradeID
        {
            get
            {

                return GetRequestValue<int>("FTradeID", 0);
            }
        }

        private FTradeReceivablesInfo _objFx = null;

        protected FTradeReceivablesInfo obj
        {
            get
            {
                if (_objFx == null)
                    _objFx = FTradeReceivablesController.GetByFTradeID(FTradeID);
                return _objFx;
            }
        }


        protected List<FTradeUpKeepInfo> dt = null;

        protected void Page_Load(object sender, EventArgs e)
        {
             dt = FTradeUpKeepController.GetAllByFTradeID(FTradeID);
            this.rpUpKeep.DataSource = dt;
            this.rpUpKeep.DataBind();
        }

        protected string getsum(string colname)
        {
            if(colname=="jine")
                return dt.Sum(e => e.JinE).ToString();
            else
                return dt.Sum(e => e.JinE2).ToString();
        }
    }
}